home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / kane / gblvars.h < prev    next >
C/C++ Source or Header  |  1990-10-01  |  15KB  |  358 lines

  1.  
  2. Date:        20-MAR-1989 17:20:25 GMT
  3. From:        PHYOKANE@CS8700.UCG.IE
  4. To:        abbottp@ASTON.AC.UK
  5. Subject:        file gblvars.h
  6. sender:     hea"phyokane@cs8700.ucg.ie"  <phyokane@cs8700.ucg.ie>
  7.  
  8. /* -*-C-*- gblvars.h */
  9. /*-->gblvars*/
  10. /**********************************************************************/
  11. /****************************** gblvars *******************************/
  12. /**********************************************************************/
  13.  
  14. /**********************************************************************/
  15. /*********************  General Global Variables  *********************/
  16. /**********************************************************************/
  17.  
  18. char curpath[MAXFNAME];            /* current file area */
  19. char curext[MAXFNAME];            /* current file extension */
  20. char curname[MAXFNAME];            /* current file name */
  21.  
  22. UNSIGN16 debug_code;            /* 0 for no debug output */
  23.  
  24. char dviname[MAXFNAME];            /* DVI filespec */
  25. char dvoname[MAXFNAME];            /* device output filespec */
  26.  
  27. char fontlist[MAXSTR];            /* FONTLIST environment string */
  28. char fontpath[MAXFNAME];        /* font directory path */
  29.  
  30. char helpcmd[MAXSTR];            /* where to look for help */
  31.  
  32. char message[MAXMSG];            /* for formatting error messages */
  33.  
  34. /***********************************************************************
  35. Magnification table for 144dpi, 200dpi, and 300dpi devices, computed
  36. to 20 figures and sorted by magnitude.
  37.  
  38.     Column 1         Column 2         Column 3
  39. 0.72*sqrt(1.2)**i  sqrt(1.2)**I  1.5*sqrt(1.2)**I    (I = -16,16)
  40.  
  41. ***********************************************************************/
  42.  
  43. static float mag_table[] =
  44.     {
  45.     0.16744898601451165028, 0.18343117374303022733, 0.20093878321741398034,
  46.     0.22011740849163627280, 0.23256803936137783874, 0.24112653986089677641,
  47.     0.25476552262595201888, 0.26414089018996352736, 0.27908164723365340649,
  48.     0.28935184783307613169, 0.30571862715114242265, 0.31696906822795623283,
  49.     0.33489797668038408779, 0.34722221739969135802, 0.34885205904206675812,
  50.     0.36686235258137090718, 0.38036288187354747940, 0.38214828393892802832,
  51.     0.40187757201646090535, 0.41666666087962962963, 0.41862247085048010974,
  52.     0.44023482309764508862, 0.45643545824825697527, 0.45857794072671363398,
  53.     0.48225308641975308642, 0.49999999305555555556, 0.50234696502057613169,
  54.     0.52828178771717410634, 0.54772254989790837033, 0.55029352887205636077,
  55.     0.57870370370370370370, 0.59999999166666666667, 0.60281635802469135802,
  56.     0.63393814526060892761, 0.65726705987749004440, 0.66035223464646763293,
  57.     0.69444444444444444444, 0.71999999000000000000, 0.72337962962962962963,
  58.     0.76072577431273071313, 0.78872047185298805327, 0.79242268157576115952,
  59.     0.83333333333333333333, 0.86399998800000000000, 0.86805555555555555556,
  60.     0.91287092917527685576, 0.94646456622358566393, 0.95090721789091339142,
  61.     1.00000000000000000000, 1.03679998560000000000, 1.04166666666666666670,
  62.     1.09544511501033222690, 1.13575747946830279670, 1.14108866146909606970,
  63.     1.20000000000000000000, 1.24415998272000000000, 1.25000000000000000000,
  64.     1.31453413801239867230, 1.36290897536196335610, 1.36930639376291528360,
  65.     1.44000000000000000000, 1.49299197926400000000, 1.50000000000000000000,
  66.     1.57744096561487840680, 1.63549077043435602730, 1.64316767251549834040,
  67.     1.72800000000000000000, 1.79159037511680000000, 1.80000000000000000000,
  68.     1.89292915873785408810, 1.96258892452122723270, 1.97180120701859800840,
  69.     2.07360000000000000000, 2.14990845014016000000, 2.16000000000000000000,
  70.     2.27151499048542490570, 2.35510670942547267930, 2.36616144842231761010,
  71.     2.48832000000000000000, 2.57989014016819200000, 2.59200000000000000000,
  72.     2.72581798858250988690, 2.82612805131056721510, 2.83939373810678113220,
  73.     2.98598400000000000000, 3.09586816820183040000, 3.11040000000000000000,
  74.     3.27098158629901186430, 3.40727248572813735860, 3.58318080000000000000,
  75.     3.73248000000000000000, 3.92517790355881423710, 4.08872698287376483030,
  76.     4.29981696000000000000, 4.47897600000000000000, 4.90647237944851779640,
  77.     5.37477120000000000000, 5.88776685533822135560, 6.44972544000000000000
  78.     };
  79.  
  80. INT16 mag_index;        /* set by actfact */
  81.  
  82. #define MAGTABSIZE (sizeof(mag_table) / sizeof(float))
  83.  
  84. int g_errenc = 0;        /* has an error been encountered?      */
  85. char g_logname[MAXSTR];        /* name of log file, if created          */
  86. BOOLEAN g_dolog = TRUE;        /* allow log file creation          */
  87. FILE *g_logfp = (FILE*)NULL;    /* log file pointer (for errors)      */
  88. char g_progname[MAXSTR];    /* program name                  */
  89.  
  90. FILE *plotfp = (FILE*)NULL;    /* plot file pointer              */
  91.  
  92. struct char_entry
  93. {                /* character entry              */
  94.    COORDINATE wp, hp;        /* width and height in pixels          */
  95.    COORDINATE xoffp, yoffp;    /* x offset and y offset in pixels      */
  96.    long fontrp;            /* font file raster pointer          */
  97.    UNSIGN32 tfmw;        /* TFM width                  */
  98.    INT32 dx, dy;        /* character escapements          */
  99.    UNSIGN16 pxlw;        /* pixel width == round(TFM width in      */
  100.                 /* pixels for .PXL files, or          */
  101.                 /* float(char_dx)/65536.0 for .GF and .PK */
  102.                 /* files)                  */
  103.    INT16 refcount;        /* reference count for memory management  */
  104.    UNSIGN32 *rasters;        /* raster description (dynamically loaded) */
  105.  
  106. #if    (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2)
  107.    BOOLEAN isloaded;        /* is the character already downloaded?   */
  108.    BOOLEAN font_switched;
  109. #endif /* (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2) */
  110.  
  111. #if    HPJETPLUS
  112.    BOOLEAN istoobig;        /* Too big (or too odd) to be loaded */
  113.    UNSIGN16    lj_char;    /* Position in printer font */
  114.    UNSIGN16    lj_font ;    /* Printer font where loaded */    
  115. #endif
  116.  
  117. #if    CANON_A2
  118.    BOOLEAN isknown;        /* Character is known */
  119.    BOOLEAN istoobig;        /* Too big to be loaded */
  120. #endif
  121.  
  122. #if    BBNBITGRAPH
  123.    BOOLEAN istoobig;        /* is the character too big for BitGraph? */
  124.    BOOLEAN isloaded;        /* is the character loaded in the BitGraph?*/
  125.    INT16 bgfont, bgchar;    /* BitGraph font and character          */
  126. #endif /* BBNBITGRAPH */
  127.  
  128. };
  129.  
  130. struct font_entry
  131. {
  132.     struct font_entry *next;    /* pointer to next font entry           */
  133.     void (*charxx)();        /* pointer to chargf(), charpk(), charpxl()*/
  134.     FILE *font_file_id;        /* file identifier (NULL if none)       */
  135.     INT32 k;            /* font number                             */
  136.     UNSIGN32 c;            /* checksum                                */
  137.     UNSIGN32 d;            /* design size                             */
  138.     UNSIGN32 s;            /* scale factor                            */
  139.     INT32 font_space;        /* computed from FNT_DEF s parameter       */
  140.     UNSIGN32 font_mag;        /* computed from FNT_DEF s and d parameters*/
  141.     UNSIGN32 magnification;    /* magnification read from PXL file       */
  142.     UNSIGN32 designsize;    /* design size read from PXL file       */
  143.     UNSIGN32 hppp;        /* horizontal pixels/point * 2**16       */
  144.     UNSIGN32 vppp;        /* vertical pixels/point * 2**16       */
  145.     INT32 min_m;        /* GF bounding box values           */
  146.     INT32 max_m;
  147.     INT32 min_n;
  148.     INT32 max_n;
  149.  
  150. #if    (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT)
  151.     UNSIGN16 font_number;    /* font number (0..32767) */
  152.    INT32    used_chars;    /* Number of chars used in this font */
  153.    INT32    assigned_chars;    /* Number of chars assigned to printer font */
  154. #endif /* (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT) */
  155.  
  156. #if    CANON_A2
  157.     COORDINATE cell_w;
  158.     COORDINATE cell_h;
  159.     COORDINATE cell_d;
  160.     UNSIGN16 nloaded;
  161.     UNSIGN32 storage;
  162. #endif /* CANON_A2 */
  163.  
  164.     BYTE font_type;        /* GF, PK, or PXL font file           */
  165.     BYTE a;            /* length of font area in n[]              */
  166.     BYTE l;            /* length of font name in n[]              */
  167.     char n[MAXSTR];        /* font area and name                      */
  168.     char name[MAXSTR];        /* full name of PXL file           */
  169.     struct char_entry ch[NPXLCHARS];/* character information           */
  170. };
  171.  
  172. struct font_list
  173. {
  174.     FILE *font_id;        /* file identifier               */
  175.     INT16 use_count;        /* count of "opens"               */
  176. };
  177.  
  178. struct printer_font
  179. {
  180.     INT16    baseline;
  181.     INT16    cell_width;
  182.     INT16    cell_height;
  183.     BOOLEAN    orientation;
  184.     BOOLEAN    prop_spaceing;
  185.     INT16    symbol_set;
  186.     INT16    pitch;
  187.     INT16    height;
  188.     BOOLEAN    style;
  189.     INT16    typeface;
  190.     INT32    slots_free;
  191.     BOOLEAN    toutched;
  192.     struct {
  193.     INT32    tex_char;    /* TeX character for this printer character */
  194.     struct font_entry    *tex_font; /* TeX font for this character   */
  195.     } char_slots[190];
  196. } printer_fonts[32];
  197.  
  198. INT32 cache_size;        /* record of how much character raster        */
  199.                 /* is actually used                */
  200. float conv;            /* converts DVI units to pixels            */
  201. UNSIGN16 copies;        /* number of copies to print of each page   */
  202. INT16 cur_page_number;        /* sequential output page number in 1..N    */
  203. INT16 cur_index;        /* current index in page_ptr[]              */
  204.  
  205. COORDINATE xcp,ycp;        /* current position                */
  206. UNSIGN32 den;            /* denominator specified in preamble        */
  207. FILE *dvifp = (FILE*)NULL;    /* DVI file pointer                */
  208. struct font_entry *fontptr;    /* font_entry pointer                */
  209. struct font_entry *hfontptr = (struct font_entry *)NULL;
  210.                 /* head font_entry pointer            */
  211.  
  212. #if    (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT)
  213. UNSIGN16 font_count;        /* used to assign unique font numbers        */
  214. struct font_entry *font_table[MAXFONTS];
  215. #endif /* (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT) */
  216.  
  217. #if    (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2)
  218. int    pf;            /* current printer font             */
  219. BOOLEAN font_switched;        /* TeX font has changed             */
  220. #endif /* (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2) */
  221.  
  222. INT16 gf_index, pk_index, pxl_index;
  223.                 /* indexes into filelist[] in fontfile();   */
  224.                 /* they define the search order, and are    */
  225.                 /* in initglob().                */
  226. UNSIGN32 gpower[33];        /* gpower[k] = 2**k-1 (k = 0..32)        */
  227. INT32 h;            /* current horizontal position            */
  228. COORDINATE hh;            /* current horizontal position in pixels    */
  229.  
  230. #if    HPLASERJET
  231. INT16 hpres;            /* output resolution (75, 100, 150, 300 dpi) */
  232. #endif /* HPLASERJET */
  233.  
  234. UNSIGN32 img_mask[32];        /* initialized at run-time so that bit k    */
  235.                 /* (counting from high end) is one        */
  236. UNSIGN32 img_row[(MAX_M - MIN_M + 1 + 31) >> 5];
  237.                 /* current character image row of bits        */
  238. INT16 max_m, min_m, max_n, min_n;
  239.                 /* current character matrix extents        */
  240. UNSIGN16 img_words;        /* number of words in use in img_row[]        */
  241. float leftmargin;        /* left margin in inches            */
  242. COORDINATE lmargin;        /* left margin offset in pixels            */
  243. INT16 nopen;            /* number of open PXL files            */
  244. INT16 page_count;        /* number of entries in page_ptr[]        */
  245.  
  246. #if    HPJETPLUS
  247. INT16 page_fonts;        /* count of fonts used on current page      */
  248. #endif /* HPJETPLUS */
  249.  
  250. long page_ptr[MAXPAGE+1];    /* byte pointers to pages (reverse order)   */
  251.  
  252. #if    POSTSCRIPT
  253. long page_loc[MAXPAGE+1];    /* byte pointers to output pages        */
  254. INT32 page_tex[MAXPAGE+1];    /* TeX's \count0 page numbers            */
  255. #endif /* POSTSCRIPT */
  256.  
  257. INT16 page_begin[MAXREQUEST+1],
  258.     page_end[MAXREQUEST+1],
  259.     page_step[MAXREQUEST+1];    /* explicit page range requests            */
  260. INT16 npage;            /* number of explicit page range requests   */
  261. struct font_list font_files[MAXOPEN+1];
  262.                 /* list of open PXL file identifiers        */
  263.  
  264. UNSIGN32 power[32];        /* power[k] = 1 << k                */
  265.  
  266. #if    POSTSCRIPT
  267. BOOLEAN ps_vmbug;        /* reload fonts on each page when TRUE        */
  268. #endif /* POSTSCRIPT */
  269.  
  270. UNSIGN32 rightones[HOST_WORD_SIZE];/* bit masks */
  271.  
  272. #if    (APPLEIMAGEWRITER | EPSON | DECLA75 | DECLN03PLUS)
  273. BOOLEAN runlengthcode = FALSE;        /* this is runtime option '-r' */
  274. #endif /* (APPLEIMAGEWRITER | EPSON | DECLA75 | DECLN03PLUS) */
  275.  
  276. #if    (GOLDENDAWNGL100 | TOSHIBAP1351)
  277. BOOLEAN runlengthcode = FALSE;        /* this is runtime option '-r' */
  278. #endif /* (GOLDENDAWNGL100 | TOSHIBAP1351) */
  279.  
  280. UNSIGN32 runmag;        /* runtime magnification            */
  281. UNSIGN32 mag;            /* magnification specified in preamble        */
  282. UNSIGN32 num;            /* numerator specified in preamble        */
  283. struct font_entry *pfontptr = (struct font_entry *)NULL;
  284.                 /* previous font_entry pointer            */
  285. BOOLEAN preload = TRUE;        /* preload the font descriptions?        */
  286. FILE *fontfp = (FILE*)NULL;    /* font file pointer                */
  287.  
  288. BOOLEAN quiet = FALSE;        /* suppress status display when TRUE        */
  289.  
  290. BOOLEAN backwards = FALSE;    /* print in backwards order            */
  291.  
  292. #if    (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT)
  293. COORDINATE rule_height;        /* parameters of last rule set */
  294. COORDINATE rule_width;
  295. COORDINATE str_ycp;        /* last string ycp value */
  296. UNSIGN16 size_limit;        /* character size limit in pixels -- larger */
  297.                 /* characters are downloaded each time they */
  298.                 /* are required to avoid PostScript ROM bugs */
  299. #endif /* (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT) */
  300.  
  301. #if    (BSD42 | OS_TOPS20)
  302. BOOLEAN spool_output = FALSE;    /* offer to send output to spooler */
  303. #endif /* (BSD42 | OS_TOPS20) */
  304.  
  305. char subpath[MAXFNAME];        /* font substitution file path            */
  306. char subname[MAXFNAME];        /* font substitution file name field        */
  307. char subext[MAXFNAME];        /* font substitution file extension field   */
  308. char subfile[MAXFNAME];        /* font substitution filename            */
  309.  
  310. INT32 tex_counter[10];        /* TeX c0..c9 counters on current page      */
  311. float topmargin;        /* top margin in inches                */
  312. COORDINATE tmargin;        /* top margin offset in pixels            */
  313.  
  314. INT32 v;            /* current vertical position            */
  315.  
  316. #if    VIRTUAL_FONTS
  317. BOOLEAN virt_font;        /* virtual font cache flag                  */
  318. struct virt_data
  319.     {
  320.     int    cnt;
  321.     char    *ptr;
  322.     char    *base;
  323.     };
  324. struct virt_data virt_save[_NFILE];/* space for saving old FILE values      */
  325. #endif /* VIRTUAL_FONTS */
  326.  
  327. COORDINATE vv;            /* current vertical position in pixels        */
  328.  
  329. #if    BBNBITGRAPH
  330. struct char_entry *bgcp[NBGFONTS+(NBGFONTS+2)/3][NPXLCHARS];
  331.     /* Pointer to corresponding char_entry for this BitGraph font */
  332.     /* and character.  These are used to set the char_entry's */
  333.     /* status to "not loaded" when we have to reuse the BitGraph */
  334.     /* character.  The array is cleared initially in devinit(). */
  335.  
  336. INT16 fullfont = 0;        /* full font to load in BitGraph        */
  337. BOOLEAN g_interactive=TRUE;    /* is the program running interactively   */
  338.                 /* (i.e., standard output not redirected)? */
  339. INT16 partchar = FIRSTBGCHAR;    /* partial font character to load in BitGraph*/
  340. INT16 partfont = NBGFONTS;    /* partial font to load in BitGraph        */
  341. INT16 pbghpos;            /* previous BitGraph horizontal position    */
  342. INT16 pbgvpos;            /* previous BitGraph vertical position        */
  343. INT16 pbgf = -1;        /* previous BitGraph font            */
  344. COORDINATE xdiff;        /* x difference                    */
  345. COORDINATE xscreen;        /* x screen adjustment                */
  346. COORDINATE ydiff;        /* y difference                    */
  347. COORDINATE yscreen;        /* y screen adjustment                */
  348. long cpagep;            /* pointer to current page in DVI file        */
  349. long ppagep;            /* pointer to previous page in DVI file     */
  350.  
  351. #if    OS_TOPS20
  352. #define jfn_plotfp (jfnof(fileno(plotfp)))
  353.  
  354. int bg_length,bg_width,bg_1ccoc,bg_2ccoc,bg_modeword,bg_sysmsg;
  355. #endif /* OS_TOPS20 */
  356.  
  357. #endif /* BBNBITGRAPH */
  358.